<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<title>租房网-找房中心</title>
	<script type="text/javascript" th:inline="javascript">
        /*<![CDATA[*/
        basePath = /*[[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]]*/'';
        //ctxPath = /*[[@{/}]]*/ '';
        /*]]>*/
	</script>
	<meta name="viewport" content="initial-scale=1.0, user-scalable=yes">
	<link rel="stylesheet" type="text/css" href="/css/pc/client/common.css">
	<!--[if lte IE 8]>
	<script src="/common/js/html5shiv.js"></script>
	<![endif]-->
	<link rel="stylesheet" type="text/css" href="/css/pc/client/list.css">
</head>
<style>
	.moresearchinfo ul li {
		float: left;
		line-height: 35px;
		margin-right: 20px;
	}
	.moresearchinfo dt {
		float: left;
		width: 50px;
		line-height: 35px;
		color: #666666;
	}
	.banner-box{
		text-align: center;
		margin-top: 25px;
	}
	.banner-box>a{
		display: inline-block;
	}
	.bargain-rules{
		color: #4FA3D5 !important;
		float: right;
		margin-right: 15px;
		display: flex;
		align-items: center;
	}
</style>
<body>
<input type="hidden" th:value="${session.username}" name="username" id="username">
<input type="hidden" th:value="${session.userId}" name="userId" id="userId">
<div class="header">
	<div class="nav-wrap">
		<div class="logo">
			<a rel="nofollow" href="#">
				<img src="/img/pc/client/home/logo.png" height="32" alt="租房网">
			</a>
		</div>
		<div class="city-wrap" style="cursor: default;">
			<span th:text="${cityName}" id="difan" th:value="${cityNameId}"></span><i></i>
			<ul>
                    <span th:each="retAddress,status:${retAddressList}">
                        <span th:if="${retAddress.cityName} != ${cityName}">
                            <li><a rel="nofollow" th:href="@{/retAddress/index(id=${retAddress.id})}" th:text="${retAddress.cityName}" class="nlihao" th:id="${retAddress.id}"></a></li>
                        </span>
                    </span>
			</ul>
		</div>
		<div class="nav-items">
			<div class="nav-item">
				<a rel="nofollow" th:href="@{/retAddress/index}">首页</a>
			</div>
			<div class="nav-item">
				<a th:href="@{/retAddress/searchList}"class="on">租房</a>
			</div>
			<div class="nav-item">
				<a rel="nofollow" href="https://www.zufun.cn/platform" target="_blank">物业平台</a>
			</div>
			<div class="nav-item user-down-wrap" id="login_holder">
				<a href="#loginModal" rel="nofollow" data-toggle="modal" data-target="#loginModal" >注册/登录</a>
			</div>
		</div>
	</div>
</div><div class="container page-list">
	<div class="search-wrap">
		<div class="col-md-10">
			<form id="zhenzu_search_form" class="search-form">
				<input type="text" placeholder="请输入楼盘名称" id="zhenzu_search_key" value="">
				<button class="search-btn"></button>
			</form>
		</div>
		<div class="col-md-2 t-r">
			<div class="btn-apt" data-url="/user/apt/new">
				<span style="color:#fff">发布房源</span>
			</div>
		</div>
	</div>
</div>
<div class="container">
	<!-- 搜索框 -->
	<div class="filter-wrap">
		<!-- 区域/地铁搜索 -->
		<div class="tab-list">
			<ul>
				<li class="tab"><a  class="link active" href="#">区域找房</a></li>
				<li class="tab"><a rel="nofollow" class="link link-to-map" th:href="@{/retAddress/ditu}">地图找房</a></li>
			</ul>
		</div>
		<!-- 区域搜索 -->
		<dl class="secitem">
			<dt class="item">区域：</dt>
			<dd id="rent_type">
				<span th:if="${#strings.isEmpty(id)}">
					<a href="#" id="rent_typeId" class="select">不限</a>
				</span>
				<span th:if="not ${#strings.isEmpty(id)}">
					<a href="#" id="rent_typeId">不限</a>
				</span>
				<span th:each="retRegion,status:${retRegionList}">
					<span th:if="${retRegion.id} == ${id}">
						<a href="#" class="select" th:data-id="${retRegion.id}" th:text="${retRegion.cityName}"></a>
					</span>
					<span th:if="${retRegion.id} != ${id}">
						<a href="#" th:data-id="${retRegion.id}" th:text="${retRegion.cityName}"></a>
					</span>
				</span>
			</dd>
		</dl>
		<!-- 地铁搜索 -->
		<!-- 租金 -->
		<dl  class="secitem">
			<dt class="item">租金：</dt>
			<dd id="rent">
				<span th:if="${#strings.isEmpty(money)}">
					<a rel="nofollow" href="#" id="rentId" data-id="" class="select">不限</a>
				</span>
				<span th:if="not ${#strings.isEmpty(money)}">
					<a rel="nofollow" href="#" id="rentId" data-id="">不限</a>
				</span>
				<span th:if="1500 == ${money}">
					<a rel="nofollow" href="#" data-id="1500" class="select">1500元以下</a>
				</span>
				<span th:if="1500 != ${money}">
					<a rel="nofollow" href="#" data-id="1500">1500元以下</a>
				</span>
				<span th:if="3000 == ${money}">
					<a rel="nofollow" href="#" data-id="3000" class="select">3000元以下</a>
				</span>
				<span th:if="3000 != ${money}">
					<a rel="nofollow" href="#" data-id="3000">3000元以下</a>
				</span>
				<span th:if="5000 == ${money}">
					<a rel="nofollow" href="#" data-id="5000" class="select">5000元以下</a>
				</span>
				<span th:if="5000 != ${money}">
					<a rel="nofollow" href="#" data-id="5000">5000元以下</a>
				</span>
				<span th:if="8000 == ${money}">
					<a rel="nofollow" href="#" data-id="8000" class="select">8000元以下</a>
				</span>
				<span th:if="8000 != ${money}">
					<a rel="nofollow" href="#" data-id="8000">8000元以下</a>
				</span>
			</dd>
		</dl>
		<!-- 户型 -->
		<dl class="secitem">
			<dt class="item">户型：</dt>
			<dd id="room">
				<a rel="nofollow"  href="#" id="roomId" class="select">不限</a>
				<a rel="nofollow"  href="#" data-id="一">一居</a>
				<a rel="nofollow"  href="#" data-id="二">两居</a>
				<a rel="nofollow"  href="#" data-id="三">三居</a>
				<a rel="nofollow"  href="#" data-id="四">四居</a>
				<a rel="nofollow"  href="#" data-id="五">四居以上</a>
			</dd>
		</dl>

		<dl class="secitem">
			<dt class="item">方式：</dt>
			<dd id="fangshi">
				<a rel="nofollow"  href="#" id="fangshiId" class="select">不限</a>
				<a rel="nofollow"  href="#" data-id="1">整租</a>
				<a rel="nofollow"  href="#" data-id="2">合租</a>
			</dd>
		</dl>
		<!-- 当前找房条件 -->
		<div class="finder">

		</div>
	</div>
</div>
<div class="container ">
	<div class="building-wrap">
		<!-- 楼盘列表 -->
		<div class="building-list" >
			<div class="sort-bar">
				<div class="sort-parent">
					<a href="#" class="on" value="默认" title="默认排序" style="border-left:none;">默认排序</a>
				</div>
				<div class="sort-parent">
					<a rel="nofollow" href="#" value="金钱" class="" title="按价格由低到高">价格</a>
				</div>
				<!--<div class="sort-parent">
					<a rel="nofollow" href="#" class="" title="按时间排序">最新</a>
				</div>-->
				<div class="total-msg" >
					<span  th:fragment="shen"><span class="c-orange" th:text="${retRentalInformationList}"></span>个楼盘，</span>
					<span  th:fragment="shen"><span class="c-orange" th:text="${fanYuancount}"></span>套出租房源</span>
				</div>
			</div>
			<hr>
			<div id="kaishi" th:fragment="baise">
				<span th:each="list,status:${List}" >
					<div class="building-item" th:id="'poi'+${status.index+1}" th:lng="${list.ret_lng}" th:lat="${list.ret_lat}"  th:data-num="${status.index+1}">
				<!-- 楼盘信息 -->
				<div class="ppt-wrap">
					<a rel="nofollow" class="pic-wrap" target="_blank" th:href="@{/retAddress/houseDetails(id=${list.house_id})}">
												<img th:src="${list.ret_picture}" th:alt="${list.lease_out}">
											</a>
					<div class="ppt-info">
						<div class="ppt-name">
														<span th:text="${status.index+1}"></span>
							<div class="title-wrap">
								<a th:href="@{/retAddress/houseDetails(id=${list.house_id})}" target="_blank" th:text="${list.lease_out}">
															</a>
								<div class="label-wrap" style="float: right; margin-right: -2px;">
									<div class="lp-label"><span class="label-name">公寓直租</span></div><div class="mian-label"><span class="label-name">近地铁</span></div>								</div>
							</div>
						</div>
						<p class="ppt-addr">
							<a class="link" th:href="@{/retAddress/houseDetails(id=${list.house_id})}" target="_blank" th:text="${list.ch_cityName}"></a>&nbsp;-&nbsp;<a th:href="@{/retAddress/houseDetails(id=${list.house_id})}" class="link" target="_blank" th:text="${list.cityName}"></a>(<span th:text="${list.ret_distance}"></span>)	</p>
													<div class="col-md-8">
								<p class="price"><span class="c-orange" th:text="${list.money}"></span>元/月起</p>
														<span th:each="ccc,index:${list.xiao}" th:if="${index.index} lt 1">
								<p class="num"><span class="c-orange" th:text="${index.size}"></span>套出租房源</p>
															</span>
							</div>
						<div class="col-md-4 t-r">
							<span th:if="not ${#lists.isEmpty(session.userId)}" th:each="retCollection,index:${retCollectionList}">
								<span th:if="${retCollection.userId} eq ${session.userId} and ${list.house_id} eq ${retCollection.rentalId}" class="c">
									<div class="coll-ppt" th:data-id="${list.house_id}" th:data-ids="${retCollection.id}"  title="取消楼盘" style="margin-right:8px;">
										<i class="picon-favorite"></i>已收藏
									</div>
								</span>
								<span th:else th:if="${index.index} eq 0">
									<div class="coll-ppt" th:data-id="${list.house_id}" th:data-ids="${retCollection.id}"  title="收藏楼盘" style="margin-right:8px;">
										<i class="picon-heart"></i>收藏
									</div>
								</span>
							</span>
							<span th:if="${#lists.isEmpty(session.userId)}">
								<div class="coll-ppt" th:data-id="${list.house_id}"  title="收藏楼盘" style="margin-right:8px;">
									<i class="picon-heart"></i>收藏
								</div>
							</span>
						</div>
					</div>
				</div>
						<!-- 房源列表 -->
								<div class="apt-items">
					<ul class="apt-title">
						<li class="col-md-2">&nbsp;</li>
						<li class="col-md-3">面积</li>
						<li class="col-md-2">楼层</li>
						<li class="col-md-3">租金</li>
					</ul>
									<span th:each="ccc,index:${list.xiao}">
										<span th:if="${ccc.leaseOut}">
											<a rel="nofollow" class="apt-item link" th:href="@{/retAddress/houseDetails(id=${ccc.retId})}" target="_blank"  >
							<ul>
								<li class="col-md-2 ppt-title"></li>
								<li class="col-md-3" th:text="${ccc.measure}+'平米'"></li>
								<li class="col-md-2" th:text="${ccc.retFanjianshu}+'层'"></li>
								<li class="col-md-3"><span class="c-orange indent" th:text="${ccc.money}"></span>元/月</li>
								<li class="col-md-2 pic-wrap">
									<img class="lazy" th:data-original="${ccc.retPicture}"  th:src="${ccc.retPicture}"  th:alt="${list.lease_out}">
								</li>
							</ul>
						</a>
											</span>
										</span>
									</div>
								<hr>
			</div>
				</span>
			</div>
		</div>
		<!-- 分页 -->
		<div id="pagination" class="pagination"></div>
		<!-- 推荐房源 -->
		<!-- 分页 -->
	</div>

	<!-- 右侧开始 -->
	<div class="listSidebar">
		<div id="float">
			<div class="sidebarMap" id="sidebarMap">
				<div class="mapRightBut link-to-map">
	                <span class="mvtMapBut">
	                    <span class="buticon"></span>
	                    <span>地图找房</span>
	                </span>
				</div>
				<div id="right_map" class="map" style="width:360px; height:340px"></div>
				<!--<a rel="nofollow" target="_blank" href="https://sz.zufun.cn/redirect?type=ad&location=2&url=https://sz.zufun.cn/zufang-list-ka741/" style="margin-top:20px;display:block;position:relative;">
    <img src="https://s.yzfcdn.com/assets/img/pc/client/adBanner/ad-banner.png" width="360" height="240">
    <span style="position:absolute; top:0; right:0; width:20px; height:20px; line-height:20px;text-align:center; color:#f8f8f8; font-size:18px; background:#999;opacity: 0.6;" data-dismiss="alert">&times;</span>
</a>-->
			</div>
		</div>
	</div>
	<!-- 右侧结束 -->
</div>
<script id="house_tpl" type="text/html">
	{{each rows as value i}}
	<a class="apt-item apt-item-more link" href="{{value.url}}" target="_blank">
		<ul>
			<li class="col-md-2">{{value.att_title}}</li>
			<li class="col-md-3">{{value.att_space}}平米</li>
			<li class="col-md-2">{{value.display_floor}}</li>
			<li class="col-md-3">{{# (value.att_init_rent && 0!=value.att_init_rent)?'<s class="c-gray">'+value.att_init_rent+'</s>&nbsp;':'';}}<span class="c-orange indent">{{value.att_rent}}</span>元/月</li>
			<li class="col-md-2 pic-wrap">
				<img src="{{value['src'] && value['src']['src_min']}}"
					 onerror="javascript:this.src='https://s.yzfcdn.com/assets/img/grey.jpg';">
			</li>
		</ul>
	</a>
	{{/each}}
</script>
<!-- /buldings -->
<div style="clear:both"></div>
<div class="new-footer" style="margin-top:20px;">
	<div class="site-zufun">
		<div class="site-info">
			<p>
				<a rel="nofollow" href="https://www.zufun.cn/about" target="_blank">关于我们</a><span>|</span>
				<a rel="nofollow" href="https://www.zufun.cn/question" target="_blank">常见问题</a><span>|</span>
				<a rel="nofollow" href="https://www.zufun.cn/business" target="_blank">商务合作</a><span>|</span>
				<a rel="nofollow" href="https://www.zufun.cn/job" target="_blank">招聘信息</a><span>|</span>
				<a rel="nofollow" href="https://www.zufun.cn/protocol" target="_blank">服务声明</a><span>|</span>
				<a rel="nofollow" href="javascript:void(0);" onclick="suggest();">意见反馈</a><span>|</span>
				<a rel="nofollow" href="/sitemap" target="_blank">网站地图</a>
			</p>
			<div class="call-us">
				<div class="qrcode-wrap">
					<span style="display: block;line-height: 1.3;white-space: nowrap;letter-spacing:2px;position: absolute;right:-30px;top: 17px;color:#999;">下载APP</span>
					<i class="icon icon-mobile" style="position:relative;right:60px;"></i>
					<i class="icon icon-app-qrcode qrcode" style="left:-102px;"></i>
				</div>
				<div class="qrcode-wrap">
					<span style="display: block;line-height: 1.3;white-space: nowrap;letter-spacing:2px;position: absolute;left:30px;top: 17px;color:#999;">关注公众号</span>
					<i class="icon icon-weixin"></i>
					<i class="icon icon-weixin-qrcode qrcode"></i>
				</div>
			</div>
		</div>
		<div class="site-copyright" style="text-align:left;">
			<p>©2015-2020 深圳易找房信息技术有限公司&nbsp;&nbsp;版权所有&nbsp;&nbsp;<a href="http://beian.miit.gov.cn" target="_blank" rel="nofollow">粤ICP备15073386号</a></p>
			<span class="hotline" style="position: absolute;top: 30px;right: 0;font-size: 14px;">服务热线：132-6682-1881（9:00 - 18:00）</span>
		</div>
	</div>
</div>
<script id="suggest_tpl" type="text/html">
	<form id="suggest_form">
		<div class="form-group">
			<div class="textarea-group">
				<label>反馈内容</label>
				<textarea name="content" placeholder="欢迎提出您在使用过程中遇到的问题或宝贵建议，感谢您的支持。"></textarea>
			</div>
			<div class="input-group" style="height:100px;">
				<label>联系方式</label>
				<input type="text" name="email" placeholder="请留下您的手机或邮箱" style="margin-top:5px;" value="{{fu_mobile}}">
			</div>
			<div class="button-group">
				<input type="submit" value="提交反馈">
			</div>
		</div>
	</form>
</script>
<!-- /forgetModal -->
<div class="modal" id="loginModal" tabindex="-1" role="dialog">
	<div class="modal-dialog-login user-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<ul class="modal-tab tab-bar" role="tablist">
					<li class="tab active"  role="presentation" style="margin: 0;">
						<a href="#quickLoginContent"  aria-controls="transportContent" role="tab" data-toggle="tab">手机验证码登录</a>
					</li>
					<li class="tab"  role="presentation" style="margin: 0;">
						<a href="#loginContent"  aria-controls="transportContent" role="tab" data-toggle="tab" >账号密码登录</a>
					</li>
				</ul>
			</div>
			<div class="modal-body">
				<div class="tab-content">
					<div role="tabpanel" class="tab-panel active" id="quickLoginContent">
						<form class="layui-form pic-form" id="quickLoginForm" style="position: relative; width: 100%; min-height: 224px; overflow: hidden;" novalidate="novalidate">
							<div id="mod_register" class="diyi" style="position: absolute; top: 0; bottom: 0; margin: auto 0; left: 0px; width: 100%; height: fit-content;">
								<div class="form-group">
									<div class="input-group">
										<input type="text" id="phone" lay-verify="required" name="fu_mobile" placeholder="手机" class="layui-input">
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<input type="text" id="vcode" name="vcode" placeholder="短信验证码">
										<span class="sms-button sms-button-error layui-input" id="huoqu" >获取验证码</span>
									</div>
								</div>
								<div class="form-group" style="margin-top: -10px !important; margin-bottom: 15px !important; color: #999; padding-left: 40px;">未注册将自动创建账号</div>
								<div class="layui-form-item form-group" style="margin-top:0;">
									<div class="button-group" style="position:relative;">
										<button class="layui-btn layui-block btn-disabled" lay-filter="logins" lay-submit="" type="button">登录</button>
									</div>
								</div>
							</div>
							<div id="mod_register_validate" class="dier" style="position: absolute; top: 0; bottom: 0; margin: auto 0; left: 400px; width: 100%; height: fit-content;">
								<div class="form-group pic-form" style="display: none">
									<div class="input-group">
										<input type="text" lay-verify="required|captcha" class="not-post layui-input" name="pic_code" placeholder="验证码">
										<div class="pic-wrap"><div class="img ok-none-select" id="captchaImg"></div></div>
									</div>
								</div>
								<div class="layui-form-item form-group" style="margin-top:0;">
									<div class="button-group" style="position:relative;">
										<button class="layui-btn layui-block" lay-filter="login" lay-submit="" type="button">登录</button>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div role="tabpanel" class="tab-panel" id="loginContent" style="margin-top:30px;">
						<form class="layui-form pic-form" id="loginForm">
							<div class="form-group">
								<div class="input-group">
									<input type="text" id="fu_mobile" lay-verify="required" name="fu_mobile" placeholder="手机">
								</div>
							</div>
							<div class="form-group">
								<div class="input-group">
									<input type="password" lay-verify="required" name="fu_password" placeholder="密码">
								</div>
							</div>
							<div class="layui-form-item form-group" style="margin-top:0;">
								<div class="button-group" style="position:relative;">
									<button class="layui-btn layui-block btn-disabled" lay-filter="logins1" lay-submit="" type="button">登录</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="/common/js/jquery-1.11.3.min.js"></script>
<script src="/libs/yzf/modules/yzf.tab.js"></script>
<script src="/libs/yzf/modules/yzf.modal.js"></script>
<script src="/libs/yzf/modules/yzf.button.js"></script>
<script src="/common/js/jquery.cookie.js"></script>
<script src="/common/js/artForm.js"></script>
<script src="/common/js/md5.js"></script>
<script src="/common/js/base.js"></script>
<script src="/common/js/validateConfig.js"></script>
<script src="/common/js/jquery.validate.js"></script>
<script src="/libs/artdialog/dist/dialog-min.js"></script>
<script src="/common/js/template.js"></script>
<script src="/common/js/jquery.lazyload.min.js"></script>
<!--[if lt IE 8]>
<script src="/libs/JSON-js-master/json2.js"></script>
<![endif]-->
<!--[if lt IE 10]>
<script src="/common/js/normalize.js"></script>
<![endif]-->
<script src="https://api.map.baidu.com/api?v=2.0&s=1&ak=M1ux3pKOl7XaGqeTfxhOK2dR"></script>
<!--[if lte IE 8]>
<script src="/common/js/base.js"></script>
<script src="/common/js/baiduMap.js"></script>
<script src="/common/js/jquery.pagination.js"></script>
<script src="/js/pc/client/search_list.js"></script>
<script>
	if (typeof Array.prototype.forEach != 'function') {
		Array.prototype.forEach = function(callback){
			for (var i = 0; i < this.length; i++){
				callback.apply(this, [this[i], i, this]);
			}
		};
	}
</script>
<![endif]-->
<script th:src="@{/lib/layui/layui.js}"></script>
<script src="/js/pc/client/zhengzu.js"></script>
<script type="text/javascript">
    layui.use(["form", "okGVerify", "okUtils", "okLayer", "jquery"], function () {
        var phone;
        let form = layui.form;
        let $ = layui.jquery;
        let okGVerify = layui.okGVerify;
        let okUtils = layui.okUtils;
        let okLayer = layui.okLayer;

        var shuju;

        let regPhone = /^[1][0-9]{10}$/;
        /**手机号验证**/
        let setInter = '';
        /**定时器对象*/
        let second = 60;//设置时间

        /**
         * 初始化验证码
         */
        let verifyCode = new okGVerify("#captchaImg");

        $("#huoqu").click(function () {
            if(!regPhone.test($("#phone").val())){
                layer.msg("输入的手机号格式不正确，请重新输入", {
                    time: 3000,
                    icon: 10
                });
            }else{
                $(".diyi").css("left", "-400px")
                $(".dier").css("left", "0px")
                $(".pic-form").css("display", "")
            }
        })


        form.verify({
            fu_mobile: [
                regPhone,
                '输入的手机号格式不正确，请重新输入'
            ],
            captcha: function (val) {
                if (verifyCode.validate(val) != "true") {
                    return verifyCode.validate(val)
                }else{
                    $(".diyi").css("left","0px")
                    $(".dier").css("left","400px")
                    $(".pic-form").css("display","")
                    /**获取验证码**/
                    let that = $("#huoqu"),
                        phone = $("#phone").val();
                    if (regPhone.test(phone)) {
                        if (!setInter) {
                            clearInterval(setInter);
                            that.text(second + "秒后获取");
                            setInter = setInterval(function () {
                                second--;
                                if (second < 1) {
                                    clearInterval(setInter);
                                    that.text("重新获取");
                                    setInter = "";
                                    second = 60;
                                } else {
                                    that.text(second + "秒后获取");
                                }
                            }, 1000);
                            $.ajax({
                                url: "/retAddress/duanxin",
                                type: "POST",
                                data:{"phone":phone},
                                dataType: "JSON",
                                success: function (data) {

                                }
                            })
                        }
                    }
                }
            }
        });

        /**
         * 表单提交
         */
        form.on("submit(logins)", function (data) {
            $("#captchaImg").text("")
            $("#captchaImg").html("")
            verifyCode = new okGVerify("#captchaImg");
            $.ajax({
                url: "/retAddress/adduser",
                type: "POST",
                data:data.field,
                dataType: "JSON",
                success: function (data) {
                    if(data == "1"){
                        layer.msg("服务器错误!", {
                            time: 3000,
                            icon: 10
                        });
                    }else if(data == "2"){
                        layer.msg("验证码错误!", {
                            time: 3000,
                            icon: 10
                        });
                    }else{
                        window.location = "/retAddress/searchList";
                    }
                }
            })
        });

        /**
         * 表单提交
         */
        form.on("submit(logins1)", function (data) {
            if(!regPhone.test($("#fu_mobile").val())){
                layer.msg("输入的手机号格式不正确，请重新输入", {
                    time: 3000,
                    icon: 10
                });
            }else{
                $.ajax({
                    url: "/retAddress/denglogin",
                    type: "POST",
                    data:data.field,
                    dataType: "JSON",
                    success: function (data) {
                        if(data == "1"){
                            layer.msg("手机账号或密码错误!", {
                                time: 3000,
                                icon: 10
                            });
                        }else{
                            window.location = "/retAddress/searchList";
                        }
                    }
                })
            }
        });


        c();


        $('.btn-apt').click(function(){
            var log=$(this).parent().parent().parent().parent().find('#login_holder').find('a');
            if(log.text()=='注册/登录'){
                // userHandler.quickLogin();
                $("#login_holder a").click();
            }
        });
        $(document).on('click','.modal-backdrop',function(){
            $('#loginModal').hide();
            $("#quickLoginForm").removeAttr("data-url");
            $(this).remove();
            $('body').removeClass('modal-open');
            $(".diyi").css("left","0px")
            $(".dier").css("left","400px")
            $(".pic-form").css("display","")
            $("#captchaImg").text("")
            $("#captchaImg").html("")
            verifyCode = new okGVerify("#captchaImg");
        });

        $("#items_btn").click(function(){
            var $parent = $(this).parent().parent();
            var data = {
                url:window.location.pathname
            };
            $parent.find("input[type='checkbox']").each(function(){
                if(this.checked){
                    data[this.name] = this.value;
                }
            });
            $.post(base.site_url('client/search/search/easyfind'),{data: JSON.stringify(data)},function(ret){
                if(ret.code === 0){
                    window.location.href = ret.data;
                }
            },'json');
        });
        //区域变量
        var rent_type;
        var rent_typetext;

        //价钱变量
        var rent;
        var renttext;

        //户型
        var room;
        var roomtext;

        //方式
        var fangshi;
        var fangshitext;

        var ccc = null;
        var zzz = null;


        $("#rent_type a").click(function () {
            rent_type = null;
            rent_typetext = null;
            zzz = "";
            rent_type = $(this).attr("data-id");
            zzz = $(this).attr("data-id");
            rent_typetext = $(this).text();
            $("#rent_type a").removeAttr("class");
            $(this).addClass("select");
            f(rent_typetext,renttext,roomtext,fangshitext)
        })

        $("#rent a").click(function () {
            rent = null;
            renttext = null;
            rent = $(this).attr("data-id");
            renttext = $(this).text();
            $("#rent a").removeAttr("class");
            $(this).addClass("select");
            f(rent_typetext,renttext,roomtext,fangshitext)
        })

        $("#room a").click(function () {
            room = null;
            roomtext = null;
            room = $(this).attr("data-id");
            roomtext = $(this).text();
            $("#room a").removeAttr("class");
            $(this).addClass("select");
            f(rent_typetext,renttext,roomtext,fangshitext)
        })

        $("#fangshi a").click(function () {
            fangshi = null;
            fangshitext = null;
            ccc = "";
            fangshi = $(this).attr("data-id");
            ccc = $(this).attr("data-id");
            fangshitext = $(this).text();
            $("#fangshi a").removeAttr("class");
            $(this).addClass("select");
            f(rent_typetext,renttext,roomtext,fangshitext)
        })


        $(".secitem dd").click(function () {
            var id = [[${cityNameId}]];
            if(rent_type == undefined){
                rent_type = 0;
                zzz = "";
            }
            if(rent == undefined){
                rent = 0;
            }
            if(room == undefined){
                room = "";
            }
            if(fangshi == undefined){
                fangshi = 0;
                ccc = "";
            }
            $("#kaishi").load("/retAddress/tiaoJian?CSId="+id+"&regionId="+rent_type+"&money="+rent+"&retWei="+room+"&huxingId="+fangshi,function () {
                ches();
            });
            $(".total-msg").load("/retAddress/zonshu?CSId="+id+"&regionId="+zzz+"&money="+rent+"&retWei="+room+"&huxingId="+ccc,function () {
                ches();
            });

        })

        $(document).on('click','.finder span span',function(){
            var zhi = $(this).attr("data-name")
            //$(this).remove();
            var id = [[${cityNameId}]];
            if(rent_typetext == zhi){
                rent_type = 0;
                rent_typetext = null;
                zzz = "";
                $("#rent_type a").removeAttr("class");
                $("#rent_typeId").addClass("select");
            }
            if(renttext == zhi){
                rent = 0;
                renttext = null;
                $("#rent a").removeAttr("class");
                $("#rentId").addClass("select");
            }
            if(roomtext == zhi){
                room = "";
                roomtext = null;
                $("#room a").removeAttr("class");
                $("#roomId").addClass("select");
            }
            if(fangshitext == zhi){
                fangshi = 0;
                fangshitext = null;
                ccc = "";
                $("#fangshi a").removeAttr("class");
                $("#fangshiId").addClass("select");
            }
            f(rent_typetext,renttext,roomtext,fangshitext)
            $("#kaishi").load("/retAddress/tiaoJian?CSId="+id+"&regionId="+rent_type+"&money="+rent+"&retWei="+room+"&huxingId="+fangshi,function () {
                ches();
            });
            $(".total-msg").load("/retAddress/zonshu?CSId="+id+"&regionId="+zzz+"&money="+rent+"&retWei="+room+"&huxingId="+ccc,function () {
                ches();
            });

        });
        $(document).on('click','#quanbu',function(){
            var zhi = $(this).attr("data-name")
            //$(this).remove();
            var id = [[${cityNameId}]];
            if(zhi == "清空全部"){
                rent_type = 0;
                rent_typetext = null;
                rent = 0;
                renttext = null;
                room = "";
                roomtext = null;
                fangshi = 0;
                fangshitext = null;
                ccc = "";
                zzz = "";
                $("#rent_type a").removeAttr("class");
                $("#rent_typeId").addClass("select");
                $("#rent a").removeAttr("class");
                $("#rentId").addClass("select");
                $("#room a").removeAttr("class");
                $("#roomId").addClass("select");
                $("#fangshi a").removeAttr("class");
                $("#fangshiId").addClass("select");
            }
            f(rent_typetext,renttext,roomtext,fangshitext)
            $("#kaishi").load("/retAddress/tiaoJian?CSId="+id+"&regionId="+rent_type+"&money="+rent+"&retWei="+room+"&huxingId="+fangshi,function () {
                ches();
            });
            $(".total-msg").load("/retAddress/zonshu?CSId="+id+"&regionId="+zzz+"&money="+rent+"&retWei="+room+"&huxingId="+ccc,function () {
                ches();
            });

        });


        $(".sort-bar div a").click(function () {
            var zhi = $(this).attr("value");
            $(".sort-bar div a").removeAttr("class");
            $(this).addClass("on");
            if(rent_type == undefined){
                rent_type = 0;
                zzz ="";
            }
            if(rent == undefined){
                rent = 0;
            }
            if(room == undefined){
                room = "";
            }
            if(fangshi == undefined){
                fangshi = 0;
                ccc = "";
            }
            $("#kaishi").load("/retAddress/tiaoJian?CSId="+id+"&regionId="+rent_type+"&money="+rent+"&retWei="+room+"&huxingId="+fangshi,function () {
                ches();
            });
            $(".total-msg").load("/retAddress/zonshu?CSId="+id+"&regionId="+zzz+"&money="+rent+"&retWei="+room+"&huxingId="+ccc,function () {
                ches();
            });

        })

        //控制前三张图片不加lazyload//
        // $('.building-list .building-item').slice(0,3).find('img').removeClass('lazy');
        // 初始化分页
       /* var total = $("#pan").text();
        var data = {"id":null,"uri":"https:\/\/sz.zufun.cn\/zufang-list\/"};
        var uri = data.uri;
        var pathname = uri.replace("https://","").split("/");
        var c_page = 1;

        if(pathname.length === 4){
            uri = uri.substr(0,data.uri.length-1);
            uri = uri+"-"
        }
        if(data.id != null){
            c_page = data.id;
        }
        if(total > 10){
            $("#pagination").pagination(total,{
                num_display_entries: 5,
                items_per_page: 20,
                prev_text: '上一页',
                next_text: '下一页',
                current_page: c_page,
                prev_show_always: false,
                next_show_always: false,
                link_to:uri+"page__id__/"
            });
        }else{
            $("#pagination").remove();
        }*/

        /**
         * 列表跳地图页面
         * @Author   King
         * @DateTime 2016-04-05T18:59:09+0800
         */
        $(".link-to-map").click(function(e){
            var data = {
                url:window.location.pathname
            }
            $.post("https://sz.zufun.cn/client/search/search/createMapLink",data,function(ret){
                if(ret.code == 0){
                    window.location.href = ret.data;
                }
            },'json');
        });

        /**
         * 楼盘收藏
         * @Author   King
         * @DateTime 2015-10-27T14:00:35+0800
         */
        /*$(".coll-ppt").click(function(e){
            var zhi = $(this).text();
            $(this).html('<i class="picon-favorite"></i>已收藏').attr('title','取消收藏');
            //$(that).html('<i class="picon-heart"></i>收藏').attr('title','收藏楼盘');
        });*/
        $(document).on('click', '.coll-ppt', function(e) {
            var username = $("#username").val();
            if(username == null || username == "" || username == undefined){
                $("#login_holder a").click();
			}else{
                var userId = $("#userId").val();
                var rentalId = $(this).attr("data-id");
                var id = $(this).attr("data-ids");
                var obj = $(this);
                $.ajax({
                    url: "/retAddress/souchen",
                    type: "POST",
                    data:{"userId":userId,"rentalId":rentalId,"id":id},
                    dataType: "JSON",
                    success: function (data) {
                        if (data == "取消成功"){
                            $(obj).html('<i class="picon-heart"></i>收藏').attr('title','收藏楼盘');
                        }else if(data == "收藏成功"){
                            $(obj).html('<i class="picon-favorite"></i>已收藏').attr('title','取消收藏');
						} else{
                            layer.msg("操作失败了哦,系统异常", {
                                time: 3000,
                                icon: 10
                            });
                        }
                    }
                })
			}
        });

        //初始化地图相关逻辑；
        var eventAggregator = new EventAggregator(),
            mapRepository = new MapRepository(eventAggregator),
            buildinglistController = new BuildingListController(mapRepository,eventAggregator),
            mapController = new MapController(mapRepository,eventAggregator);
    });

    function f(rent_type,renttext,roomtext,fangshitext) {
        $(".finder").html("");
        var arrt =[{"zhi":rent_type},{"zhi":renttext},{"zhi":roomtext},{"zhi":fangshitext}];
        var srt = "<span>";
        var i = 0;
        var c = 0;
        $.each(arrt,function (index,e){
            if(this.zhi != null && this.zhi !="" && this.zhi != "不限"){
                srt+="<span data-name='"+this.zhi+"'><a rel='nofollow' class='term' href='#'>"+this.zhi+"</a><span class='icon_trash'></span></span>";
                c++;
            }else{
                i++;
            }
            if(i == 4){
                srt+="<span class='floatl' id='noncond'>没有指定条件</span>";
                i = 0;
            }
        });
        srt +="</span>";
        $(".finder").append(srt);
        if(c != 0){
            var html = "<a rel='nofollow' id='quanbu' data-name='清空全部' href='#'></a>";
            $(".finder").append(html);
        }
    }

    function c() {
        var user = $("#username").attr("value");
        var t = $("#login_holder");
		user ? t.html('<div class="drop-wrap"><a href="/retPersonage/personage"><span class="icon_user"></span><span>' + user + '</span></a><ul class="arrow-top nav-down-wrap"><li><a href="/retPersonage/personage" target="_blank">个人中心</a></li><li><a href="/retAddress/logout" data-toggle="logout">退出登录</a></li></ul>') : t.html('<a href="#loginModal" rel="noffolow" data-toggle="modal" data-target="#loginModal">注册/登录</a>')

    }


    function ches(){
        var userId = $("#userId").val();
        userId ? $(".c").parent().siblings().css("display","none") :$(".c").parent().siblings().css("display","")
        userId ? $(".c").siblings().css("display","none") :$(".c").siblings().css("display","")
	}
	ches();
    f(null);

</script>
</body>
</html>